package com.jnevision.leave.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jnevision.common.CommonQuery;
import com.jnevision.leave.model.Leave;
import com.jnevision.leave.model.LeaveVO;

import io.lettuce.core.dynamic.annotation.Param;

/**
 * <p>
 * 请假 Mapper 接口
 * </p>
 *
 * @author gavin
 * @since 2019-07-13
 */
@Mapper
public interface LeaveMapper extends BaseMapper<Leave> {
    List<LeaveVO> getApprove(String userId);

    LeaveVO getApproveDetail(String leaveRecordId);

    IPage<LeaveVO> page(Page<LeaveVO> page, @Param("commonQuery") CommonQuery commonQuery,
        @Param("result") Integer result);

    IPage<LeaveVO> myLeaves(Page<LeaveVO> page, @Param("userId") String userId);

    List<LeaveVO> leaveFinished(String userId, String start, String end);

    String myLeaveDuration(CommonQuery query);

    String hunjia(CommonQuery query);

    String sangjia(CommonQuery query);
}
